home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 14
/
014.d81
/
finding all
< prev
next >
Wrap
Text File
|
2022-08-26
|
718b
|
46 lines
FINDING ALL SOLUTIONS
Given the linear diophantine equation
AX + BY = N,
and assume that there exists one
solution X',Y'.
A B
Let A' = ---- and B' = ---- .
(A,B) (A,B)
Then ALL solutions can be written in
the form
X = X' + KB' Y = Y' - KA'
where K ranges over all integers.
This means that if we can find one
solution to the linear diophantine
equation, then there are infinitely
many solutions, and they can all be
generated from the one found first.
Hit "\" if you want to run the program
\oad"diophantine",8
which solves a diophantine equation
now.
Al Vekovius
---------< end of article >-----------